package com.jindun.common;

public class SQLUtil {
	public static String buildWildcardLike (String field, String text) {
		if (StringUtil.isEmpty(text)) {
			return "";
		} else {
			String str = text.replaceAll("'", "\\'");
			str = field + " like '%" + str + "%'";
			return str;
		}
		
	}
	
	public static String toSQLString (String text) {
		if (StringUtil.isEmpty(text)) {
			return "''";
		} else {
			return "'" +  text.replaceAll("'", "\\'") + "'";
		}
	}
}
